(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
        typeof define === 'function' && define.amd ? define(factory) :
            (factory());
}(this, (function () { 'use strict';

    var $loginQr = $('.login-qr');
    var $loginTypes = $('.login-type a');

    $(document).on('click', '.btn-login-qr', function () {
        $loginQr.addClass('visible');
    });

    $(document).on('click', '.btn-login-account', function () {
        $loginQr.removeClass('visible');
    });

    $(document).on('click', '.choose-account-table tr', function () {
        var $this = $(this);
        var radioEl = $this.find('input[type="radio"]')[0];

        if (radioEl.checked) {
            radioEl.removeAttribute('checked');
        } else {
            radioEl.checked = true;
        }
    });

    $(document).on('click', '.btn-login-account', function () {
        $loginTypes.removeClass('active');
        $(this).addClass('active');
        cancelQrCode();
    });

    $(document).on('click', '.btn-login-qr', function () {
        $loginTypes.removeClass('active');
        $(this).addClass('active');
        showQRCodeWin();
    });

})));
